cordova.define("com.mLink.cordova.plugin.fileTransfer.fileTransfer", function(require, exports, module) {

var exec = require('cordova/exec'),cordova = require('cordova');
var fileTransfer = function(){};
// //获取所有可上传的文件列表
// //返回数据样式
// /**
// [
// {fileName:'文件1.doc',filePath:'file:///....'},
// {fileName:'文件2.pdf',filePath:'file:///....'},
// {fileName:'文件3.pdf',filePath:'file:///....'},
// {fileName:'文件4.xls',filePath:'file:///....'},
// ]
// */
// fileTransfer.prototype.getAllFileList = function (success, fail) {
//   exec(success,fail,"fileTransfer","getAllFileList",[]);
// }

// //上传指定文件
// //userid  用于上传的用户id
// //url  上传的url地址
// //fileObj 文件对象
// /**
// {fileName:'文件1.doc',filePath:'file:///....'}
// */
// fileTransfer.uploadFile = function (userid,url,fileObj,success, fail) {
//   exec(success,fail,"fileTransfer","uploadFile",[userid,url,fileObj]);
// }

//保存用户id到本地
fileTransfer.prototype.setUserId = function(userId,success,fail){
	exec(success,fail,"fileTransfer","setUserId",[userId]);
}

//保存用户id到本地
fileTransfer.prototype.getUserInfo = function(isDelete,success,fail){
	exec(success,fail,"fileTransfer","getUserInfo",[isDelete]);
}
//获取用户保存的channlID
fileTransfer.prototype.getChannlID = function(success,fail){
	exec(success,fail,"fileTransfer","getChannlID",[]);
}

//调用wps预览附件
fileTransfer.prototype.previewFile = function(fileUrl,fileName,success,fail){
	exec(success,fail,"fileTransfer","previewFile",[fileUrl,fileName]);
}
//清除本地下载的附件
fileTransfer.prototype.deleteFile = function(success,fail){
	exec(success,fail,"fileTransfer","deleteFile",[]);
}

module.exports = new fileTransfer();

});
